﻿@model WebApplication.Models.DataSet

@{
    ViewBag.Title = "DataSet " + Model.name;
    List<string> state = new List<string>
    {
        "new", "run", "completed", "suspended"
    };



   
}

<h2>
    @Html.Label( "DataSet "+Model.name)
</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">

        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => model.id)


        <div class="form-group">
            @Html.Label("Name", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.name, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.name, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.Label("Note", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.note, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.note, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="form-group">
            @Html.Label("File", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.ActionLink("Download", "GetFile//" + Model.id)
            </div>
        </div>

        <div class="form-group">

            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />

            </div>
        </div>
    </div>

    <h2>
        Works
    </h2>

    <table class="table">
        <tr>
            <th>
                @Html.DisplayName("Name")
            </th>
            <th>
                @Html.DisplayName("State")
            </th>
            <th>
                @Html.DisplayName("Time")
            </th>

          
            <th></th>
        </tr>

        @foreach (var item in Model.Work)
        {
            <tr>
                <td>
                 
                    @Html.ActionLink(item.name, "Edit/" + item.id, "Work")

                </td>
                <td>
                    @Html.DisplayName(state[item.state])
                </td>
                <td>
                    @Html.DisplayName(item.startTime.ToString())
                </td>

             


            </tr>
        }

    </table>



    <h2>
       Complit ANNs
    </h2>

    <table class="table">
        <tr>
            <th>
                @Html.DisplayName("Name")
            </th>
            <th>
                @Html.DisplayName("Time")
            </th>

            <th>
                @Html.DisplayName("Error")
            </th>
            <th></th>
        </tr>

        @foreach (var item in Model.Ann)
        {
            <tr>
                <td>
                    @Html.ActionLink(item.name, "Edit/" + item.id, "ANN")
                 

                </td>
             
                <td>
                    @Html.DisplayName(item.dateTime.ToString())
                </td>

            
                <td>
                    @Html.DisplayName(item.test!=null? item.test :"")
                </td>

            </tr>
        }

    </table>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>


@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
